import { formatSpacesList } from '@/components/spaces/format';
import { formatIssuesList } from '@/components/spaces/issues/format';
import { formatResources } from '@/components/spaces/resources-v2/format';

export const formatSearchType = (type) => {
  switch (type) {
    case 'spaces': return 'Product';
    case 'docs': return 'ProductFile';
    case 'issues': return 'Issue';
    case 'users': return '';
    default:
      console.error('formatSearchType 未知的搜索类型');
      return '';
  }
};

export const formatResults = (results, type) => {
  switch (type) {
    case 'spaces': return formatSpacesList(results);
    case 'docs': return formatResources(results);
    case 'issues': return formatIssuesList(results);
    case 'users': return [];
    default:
      console.error('formatResults 未知的搜索类型');
      return [];
  }
};
